#include "stdafx.h"
#include "CppUnitTest.h"

#include <HSModel/Model3DUtils.h>
#include <HSModel/Ground.h>

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace HSModelTests
  {
  TEST_CLASS(Model3DUtilsTests)
    {
    public:

      TEST_METHOD(ShouldPermitToPlaceObject)
        {
        // TODO: Your test code here
        HeightMap height_map = HeightMap(10, 10); 
        GeneratedHeightMapWithDiamondSquare(height_map, 1.0, 10);
        Ground ground(height_map, 10.0, 0.0);
        
        Assert::IsTrue(Model3DUtils::CanPlaceObjectOn(std::make_pair(1u, 3u), &ground, 5));
        }

      TEST_METHOD(ShouldDenyToPlaceObject)
        {
        // TODO: Your test code here
        HeightMap height_map = HeightMap(10, 10); 
        GeneratedHeightMapWithDiamondSquare(height_map, 1.0, 10);
        height_map.Set(1, 2, 100);
        height_map.Set(1, 3, 100);
        Ground ground(height_map, 10.0, 0.0);
        
        Assert::IsFalse(Model3DUtils::CanPlaceObjectOn(std::make_pair(1u, 3u), &ground, 5));
        }
    };
  }